<template>
  <div class="attribution">
    <van-cell is-link title="属性" @click="show = true"  />
    <van-action-sheet v-model="show" closeable close-on-click-action >
      <div class="content">
        <van-row v-for=" (item, index) in attributes" :key="index" style="font-size: 16px; margin-bottom: 10px;">
          <van-col span="8">{{ item.attribute }}</van-col>
          <van-col span="16">{{ item.value }}</van-col>
        </van-row>
      </div>
    </van-action-sheet>
  </div>
</template>

<script>
export default {
  name: 'Attribution',
  components: {

  },
  computed: {
    specificationList () {
      return this.$store.state.Classification.detailData.specificationList[0]
    },
    attributes () {
      const newArr = []
      this.$store.state.Classification.detailData.attribute.forEach(item => {
        const newObj = {}
        newObj.attribute = item.attribute
        newObj.value = item.value
        newArr.push(newObj)
      })
      return newArr
    }
  },
  data () {
    return {
      show: false
    }
  },
  watch: {

  },
  mounted () {

  },
  methods: {
    onSelect () {
      // 默认情况下点击选项时不会自动收起
      // 可以通过 close-on-click-action 属性开启自动收起
      this.show = false
      // Toast(item.name)
    }
  }
}

</script>
<style scoped lang='scss'>
.content {
  padding: 20px 20px;
}
</style>
